﻿@page "/"
@using Microsoft.AspNetCore.Components.QuickGrid

<h1>Quick Grid sample</h1>

<QuickGrid Items="@people" class="table">
    <PropertyColumn Property="@(p => p.PersonId)" Title="ID" Sortable="true" />
    <PropertyColumn Property="@(p => p.Name)" Title="Name" Sortable="true" />
    <PropertyColumn Property="@(p => p.BirthDate)" Title="Birth date" Format="yyyy-MM-dd" Sortable="true" />
    <PropertyColumn Property="@(p => p.IsMarried)" Title="Is Married" Sortable="true" />
</QuickGrid>

@code
{
    record Person(int PersonId, string Name, DateOnly BirthDate, bool IsMarried);

    IQueryable<Person> people = new[]
    {
        new Person(10895, "Jean Martin", new DateOnly(1985, 3, 16), true),
        new Person(10944, "António Langa", new DateOnly(1991, 12, 1), false),
        new Person(11203, "Julie Smith", new DateOnly(1958, 10, 10), true),
        new Person(11205, "Nur Sari", new DateOnly(1922, 4, 27), false),
        new Person(11898, "Jose Hernandez", new DateOnly(2011, 5, 3), true),
        new Person(12130, "Kenji Sato", new DateOnly(2004, 1, 9), false),
    }.AsQueryable();
}
